package com.jumi.microservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jumi.microservice.entity.JmJpushUser;
import com.jumi.microservice.mapper.JmJpushUserMapper;
import com.jumi.microservice.service.IJmJpushUserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 移动端登录令牌表 服务实现类
 * </p>
 *
 * @author 要挑客户管理团队
 * @since 2020-10-26
 */
@Service
public class JmJpushUserServiceImpl extends ServiceImpl<JmJpushUserMapper, JmJpushUser> implements IJmJpushUserService {

    @Override
    public JmJpushUser getJgPushByRegisterId(String registerId, Integer uid) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("register_id", registerId);
        wrapper.eq("uid", uid);
        return getOne(wrapper);
    }

    @Override
    public List<JmJpushUser> getJgPushByUid(Integer uid) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("uid", uid);
        wrapper.eq("status",1);
        return list(wrapper);
    }
}
